1. Field of the Invention
The present invention relates to a key scanning apparatus for a computer system, and more specifically to a key scanning apparatus suitable for use in a microcomputer.
2. Description of the Related Art
FIG. 3 is a block diagram showing a prior-art key scanning apparatus. In a microcomputer 1, in general, output terminals 5 for outputting a display drive signal to drive a display element 3 are used in common with output terminals for outputting a key scan signal to scan select lines of a key matrix 7. This is because when two separate terminals are provided, the number of terminals increases. As shown in FIG. 4, key scan timing periods are periodically interposed during the display operation, and interruption to a key scan routine (referred to as key scan interrupt) is requested to a CPU (not shown) in response to a rise time of the key scan timing period.
In the prior-art microcomputer, in response to the key scan interrupt, the CPU outputs the key scan signal via the display drive output terminal 5 and simultaneously reads a key data from the key matrix 7. In addition to the above operation, the CPU monitors the time elapsed, and restarts the display operation, because the key scan timing is released after a constant time determined as a key scan timing has elapsed.
With the advance of more complex microcomputer applications, there exists a need for higher key scan performance. In the conventional microcomputer, however, the processing for reading the key data and also almost all processing for scanning keys (e.g. generation of a key scan signal, monitoring of key scan timing, etc.) is executed by the CPU in dependence upon software. Thus, a large work load is applied to the CPU and software, so that it has been difficult to improve the key scan performance without exerting a harmful influence upon other processing functions.
In addition, since the display is interrupted in the key scan timing period, the key scan timing must be limited to such a short time period that no harmful influence (e.g. flickering) is exerted upon the display operation. Therefore, when other interruption factors each having a priority higher than that of the key scan interrupt occur in parallel, the key scan interrupt which has a lower priority order in general is delayed as shown in FIG. 5; since interruptions are executed in accordance with a priority order determined by a daisy chain of interrupt reception. This results in a problem in that it is difficult to complete the key scan processing within a limited key scan timing period. On the other hand, in the system in which the key scan timing release is controlled by the CPU, since the display interrupt time period inevitably increases, there arises another problem in that the display quality is deteriorated due to, for example, flickering.